﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Sublimation.Behaviours
{
    public class UnitRandomBehaviour : Behaviour
    {
        protected WorldProperties worldProperties;
        protected GameObject owner;
        protected float weight;
        public float getWeight() { return this.weight; }

        public UnitRandomBehaviour(WorldProperties worldProperties, GameObject owner, float weight)
        {
            this.worldProperties = worldProperties;
            this.owner = owner;
            this.weight = weight;
        }

        public Vector2 RunBehaviour()
        {
            // move in a random direction at a random speed up to max speed

            //return (new Vector2((float)worldProperties.Random.NextDouble() * 2.0f - 1.0f, (float)worldProperties.Random.NextDouble() * 2.0f - 1.0f) * owner.MaxSpeed * weight);

            // move in a random direction at full speed
            return new Vector2((float)Math.Atan(worldProperties.Random.NextDouble()), (float)Math.Atan(worldProperties.Random.NextDouble()));
        }
    }
}
